require 'typedef'

os.execute("mkdir db")

use_cpp_types()


file_tag = ""
file_tags = {"Player", "Role", "Item", "Form", "Progress", "CoolDown"}


for _, tag in ipairs(file_tags) do
	file_tag = tag
	bind("template/template_db.h", "../db_".. tag .. ".lua", "db/DBMessage" .. tag .. ".h")
end


os.execute("xcopy db\\*.h ..\\..\\TGame\\TCommonSvr\\Message /R /Y")

os.execute("rmdir /S /Q db")
